<template>
	<view>
		<u-card :head-style="{'padding':'8px'}" 
				 v-for="(item,index) in userEvaluateDO.evaluateInfo.questionsDOList" 
				:key="item.eqId" 
				:title="item.name!=undefined?item.name:item.commentcontent" >
			<view  slot="body">
				<view v-if="item.child==undefined">
					<view>
						<u-input  v-model="item.userInputText"  type="textarea"></u-input>
					</view>
				</view>
				<view style="line-height: 45rpx;" v-else>
					<view  v-for="(item2,index) in item.child" :key="index">
						<p>{{(index+1)+'、'+item2.commentcontent}}</p>
						<u-radio-group  v-if="!item2.scoring" style="position: relative; left: 40rpx;" v-model="item2.radioValue">
							<u-radio    v-for="item3 in item2.scoreitemDOList" :name="item3.fraction" :key="item2.sid">{{item3.content}}</u-radio>
						</u-radio-group>
						<view  v-else>
							<u-row>
								<u-col span="11">
									<slider    :max="Math.max.apply(Math,item2.scoreitemDOList.map(m=>m.fraction))"  :value="item2.radioValue" >
									</slider>
								</u-col>
								<u-col span="1">
									{{item2.radioValue}}
								</u-col>
							</u-row>
						</view>
					</view>
				</view> 
			</view>
		</u-card>
		<u-card :head-style="{'padding':'8px'}"  title="总体评价">
			<view  slot="body">
				<u-row  gutter="16" justify="center">
					<u-radio-group v-model="userEvaluateDO.overallScore">
						<u-radio  
						v-for="item in overallScoreList" 
						:key="item.value"  
						:name="item.value">
						{{item.name}}
						</u-radio>
					</u-radio-group>
				</u-row>
			</view>
		</u-card>
		<drag-button :isDock="true" ></drag-button>
	</view>
</template>

<script>
import dragButton from '../../components/drag-button/drag-button.vue'
	export default{
		components:{
			dragButton
		},
		data(){
			return{
				classId:null,
				taskTeacherId:null,
				overallScoreList:[
					{
						"value":"D",
						"name":"不合格"
					},
					{
						"value":"C",
						"name":"合格"
					},
					{
						"value":"B",
						"name":"良好"
					},
					{
						"value":"A",
						"name":"优秀"
					}]
			}
		},
		onLoad(item) {
			this.classId = item.classId
			this.taskTeacherId = item.taskTeacherId
		},
		computed:{
			userEvaluateDO(){
					return this.$store.state.myTaskList?.
					find(f=>f.taskTeacherId == this.taskTeacherId).taskDO.classDOList?.
					find(f=> f.classId == this.classId).userEvaluateDO
				},
			myTaskList1(){
				return this.$store.state.myTaskList
			}	
		},
	}
</script>

<style>
	page{
			 background-color: #f7f7f7;;
		 }
</style>
